﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using FalionForm.Data;
using System.ComponentModel;
using System.Collections.ObjectModel;
using VisionConfig;
using System.Windows;

namespace FalionForm
{
    public class UseData
    {
        public static HTuple[] Model3D=new HTuple[20];
        public static HTuple[] Model3DDisp = new HTuple[20];

    }


    public static class PublicData
    {
        public static InfoIntiza infoIntiza;
        public static ObservableCollection<CalibList> Clist;
        public static SaveData publicData;
        public static CalibDataSave calibDataSave;


        public static int save(string Path, string Name)
        {
            try
            {
                SaveData mn = PublicData.publicData;
                checkDir(@"Temp\");
                FileStream fs = new FileStream(@"Temp\" + Name, FileMode.Create);  /*打开序列化文件，如果不存在则创建*/
                BinaryFormatter bf = new BinaryFormatter();  /*新建序列化器*/
                bf.Serialize(fs, mn);   /*将数据保存到序列化文件中*/
                fs.Close();
            }
            catch
            {
                return -1;
            }
            File.Copy(@"Temp\" + Name, Path + Name, true);
            return 0;
        }
        public static int read(string Path, string Name)
        {
            try
            {
                FileStream fs = new FileStream(Path + Name, FileMode.Open);
                BinaryFormatter bf = new BinaryFormatter();
                PublicData.publicData = (SaveData)bf.Deserialize(fs);
                fs.Close();
                InitializeSaveData(PublicData.publicData);
                infoIntiza = publicData.infoIntiza;
                Clist = publicData.Clist;
                calibDataSave = publicData.cs;

                LoadData();
            }
            catch (HalconException HDevExpDefaultException)
            {
                MessageBox.Show(HDevExpDefaultException.ToString());
                return -1;
            }
            return 0;
        }
        public static void InitializeSaveData(SaveData saveData)//数据初始化
        {
            Type t1 = (new SaveData()).GetType();
            //PropertyInfo[] pis = t1.GetProperties();
            //MethodInfo[] mis = t1.GetMethods();
            FieldInfo[] fis = t1.GetFields();
            for (int i = 0; i < fis.Length; i++)
            {
                if (fis[i].GetValue(saveData) == null)
                {
                    fis[i].SetValue(saveData, Activator.CreateInstance(fis[i].FieldType));
                }
            }
        }
        static bool checkDir(string url)
        {
            try
            {
                if (!Directory.Exists(url))//如果不存在就创建file文件夹　　             　　              
                    Directory.CreateDirectory(url);//创建该文件夹　　            
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }

        static void LoadData()
        {
            for (int i = 0; i < Clist.Count; i++)
            {
                if (Clist[i].Number>=1)
                {
                    HTuple hv_TempStatus, PiontStatus;
                    HOperatorSet.GetObjectModel3dParams(UseData.Model3DDisp[Clist[i].Number], "has_points", out PiontStatus);
                    if (PiontStatus.Length != 0 && PiontStatus == "true")
                    {
                        HOperatorSet.ClearObjectModel3d(UseData.Model3DDisp[Clist[i].Number]);
                    }
                    string Path = "./3DModel/" + Clist[i].Number.ToString() + ".obj";
                    HOperatorSet.ReadObjectModel3d(Path, "m", new HTuple(), new HTuple(),
                    out UseData.Model3DDisp[Clist[i].Number], out hv_TempStatus);


                    //清空匹配模型
                    if (UseData.Model3D[Clist[i].Number] !=null&&UseData.Model3D[Clist[i].Number].Length!=0)
                    {
                        HOperatorSet.ClearSurfaceModel(UseData.Model3D[Clist[i].Number]);
                    }
                    HOperatorSet.ReadSurfaceModel("./3DModel/" + Clist[i].Number.ToString() + ".SFM", out UseData.Model3D[Clist[i].Number]);
                }
            }
        }
    }




    [Serializable]
    public class SaveData
    {
        public LoginData loginData = new LoginData();
        public InfoIntiza infoIntiza = new InfoIntiza();
        public ObservableCollection<CalibList> Clist = new ObservableCollection<CalibList>();
        public CalibDataSave cs = new CalibDataSave();
    }


    [Serializable]//初始化数据保存
    public class InfoIntiza : INotifyPropertyChanged
    {
        int xmin;
        public int Xmin
        {
            get
            {
                return xmin;
            }
            set
            {
                xmin = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Xmin"));
                }
            }
        }
        int xmax;
        public int Xmax
        {
            get { return xmax; }
            set
            {
                xmax = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Xmax"));
                }
            }
        }
        int ymin;
        public int Ymin
        {
            get { return ymin; }
            set
            {
                ymin = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Ymin"));
                }
            }
        }
        int ymax;
        public int Ymax
        {
            get { return ymax; }
            set
            {
                ymax = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Ymax"));
                }
            }
        }
        int zmin;
        public int Zmin
        {
            get { return zmin; }
            set
            {
                zmin = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Zmin"));
                }
            }
        }
        int zmax;
        public int Zmax
        {
            get { return zmax; }
            set
            {
                zmax = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Zmax"));
                }
            }
        }

        double sobelMaxTheshold;
        public double SobelMaxTheshold
        {
            get { return sobelMaxTheshold; }
            set
            {
                sobelMaxTheshold = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("SobelMaxTheshold"));
                }
            }
        }

        double erosionSize; //对点云采样
        public double ErosionSize
        {
            get { return erosionSize; }
            set
            {
                erosionSize = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("ErosionSize"));
                }
            }
        }


        double fillupMaxArea;//百分比
        public double FillupMaxArea
        {
            get { return fillupMaxArea; }
            set
            {
                fillupMaxArea = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("FillupMaxArea"));
                }
            }
        }

        double areaMax;  //最小得分
        public double AreaMax
        {
            get { return areaMax; }
            set
            {
                areaMax = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("AreaMax"));
                }
            }
        }

        int areaMin; //匹配数量
        public int AreaMin
        {
            get { return areaMin; }
            set
            {
                areaMin = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("AreaMin"));
                }
            }
        }


        int dilatedSize;
        public int DilatedSize
        {
            get { return dilatedSize; }
            set
            {
                dilatedSize = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("DilatedSize"));
                }
            }
        }
        int sobelValue;
        public int SobelValue
        {
            get { return sobelValue; }
            set
            {
                sobelValue = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("SobelValue"));
                }
            }
        }
        double sobelMinTheshold;
        public double SobelMinTheshold
        {
            get { return sobelMinTheshold; }
            set
            {
                sobelMinTheshold = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("SobelMinTheshold"));
                }
            }
        }


        double fillupMinArea;
        public double FillupMinArea
        {
            get { return fillupMinArea; }
            set
            {
                fillupMinArea = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("FillupMinArea"));
                }
            }
        }


        int valid_range;
        public int Valid_range
        {
            get { return valid_range; }
            set
            {
                valid_range = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Valid_range"));
                }
            }
        }

        double recognition_threshold;
        public double Recognition_threshold
        {
            get { return recognition_threshold; }
            set
            {
                recognition_threshold = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Recognition_threshold"));
                }
            }
        }

        [field: NonSerializedAttribute()]
        public event PropertyChangedEventHandler PropertyChanged;
    }
    [Serializable]
    public class CalibList//标定列表数据保存
    {
        public double X
        { get; set; }
        public double Y
        { get; set; }
        public double Z
        { get; set; }
        public double g
        { get; set; }
        public double b
        { get; set; }
        public double a
        { get; set; }
        public int Number
        { get; set; }
        public string Description
        { get; set; }
    }
    [Serializable]//手眼标定数据保存
    public class CalibDataSave : INotifyPropertyChanged
    {
        [field: NonSerializedAttribute()]
        public event PropertyChangedEventHandler PropertyChanged;

        public double Picture_x1
        {
            get { return picture_x1; }
            set
            {
                picture_x1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_x1"));
                }
            }
        }
        public double Picture_x2
        {
            get { return picture_x2; }
            set
            {
                picture_x2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_x2"));
                }
            }
        }
        public double Picture_x3
        {
            get { return picture_x3; }
            set
            {
                picture_x3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_x3"));
                }
            }
        }
        public double Picture_x4
        {
            get { return picture_x4; }
            set
            {
                picture_x4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_x4"));
                }
            }
        }
        public double Picture_x5
        {
            get { return picture_x5; }
            set
            {
                picture_x5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_x5"));
                }
            }
        }
        public double Picture_x6
        {
            get { return picture_x6; }
            set
            {
                picture_x6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_x6"));
                }
            }
        }

        public double Picture_y1
        {
            get { return picture_y1; }
            set
            {
                picture_y1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_y1"));
                }
            }
        }
        public double Picture_y2
        {
            get { return picture_y2; }
            set
            {
                picture_y2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_y2"));
                }
            }
        }
        public double Picture_y3
        {
            get { return picture_y3; }
            set
            {
                picture_y3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_y3"));
                }
            }
        }
        public double Picture_y4
        {
            get { return picture_y4; }
            set
            {
                picture_y4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_y4"));
                }
            }
        }
        public double Picture_y5
        {
            get { return picture_y5; }
            set
            {
                picture_y5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_y5"));
                }
            }
        }
        public double Picture_y6
        {
            get { return picture_y6; }
            set
            {
                picture_y6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_y6"));
                }
            }
        }

        public double Picture_z1
        {
            get { return picture_z1; }
            set
            {
                picture_z1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_z1"));
                }
            }
        }
        public double Picture_z2
        {
            get { return picture_z2; }
            set
            {
                picture_z2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_z2"));
                }
            }
        }
        public double Picture_z3
        {
            get { return picture_z3; }
            set
            {
                picture_z3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_z3"));
                }
            }
        }
        public double Picture_z4
        {
            get { return picture_z4; }
            set
            {
                picture_z4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_z4"));
                }
            }
        }
        public double Picture_z5
        {
            get { return picture_z5; }
            set
            {
                picture_z5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_z5"));
                }
            }
        }
        public double Picture_z6
        {
            get { return picture_z6; }
            set
            {
                picture_z6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_z6"));
                }
            }
        }

        public double Picture_g1
        {
            get { return picture_g1; }
            set
            {
                picture_g1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_g1"));
                }
            }
        }
        public double Picture_g2
        {
            get { return picture_g2; }
            set
            {
                picture_g2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_g2"));
                }
            }
        }
        public double Picture_g3
        {
            get { return picture_g3; }
            set
            {
                picture_g3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_g3"));
                }
            }
        }
        public double Picture_g4
        {
            get { return picture_g4; }
            set
            {
                picture_g4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_g4"));
                }
            }
        }
        public double Picture_g5
        {
            get { return picture_g5; }
            set
            {
                picture_g5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_g5"));
                }
            }
        }
        public double Picture_g6
        {
            get { return picture_g6; }
            set
            {
                picture_g6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_g6"));
                }
            }
        }

        public double Picture_b1
        {
            get { return picture_b1; }
            set
            {
                picture_b1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_b1"));
                }
            }
        }
        public double Picture_b2
        {
            get { return picture_b2; }
            set
            {
                picture_b2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_b2"));
                }
            }
        }
        public double Picture_b3
        {
            get { return picture_b3; }
            set
            {
                picture_b3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_b3"));
                }
            }
        }
        public double Picture_b4
        {
            get { return picture_b4; }
            set
            {
                picture_b4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_b4"));
                }
            }
        }
        public double Picture_b5
        {
            get { return picture_b5; }
            set
            {
                picture_b5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_b5"));
                }
            }
        }
        public double Picture_b6
        {
            get { return picture_b6; }
            set
            {
                picture_b6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_b6"));
                }
            }
        }

        public double Picture_a1
        {
            get { return picture_a1; }
            set
            {
                picture_a1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_a1"));
                }
            }
        }
        public double Picture_a2
        {
            get { return picture_a2; }
            set
            {
                picture_a2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_a2"));
                }
            }
        }
        public double Picture_a3
        {
            get { return picture_a3; }
            set
            {
                picture_a3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_a3"));
                }
            }
        }
        public double Picture_a4
        {
            get { return picture_a4; }
            set
            {
                picture_a4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_a4"));
                }
            }
        }
        public double Picture_a5
        {
            get { return picture_a5; }
            set
            {
                picture_a5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_a5"));
                }
            }
        }
        public double Picture_a6
        {
            get { return picture_a6; }
            set
            {
                picture_a6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Picture_a6"));
                }
            }
        }

        public double Robot_x1
        {
            get { return robot_x1; }
            set
            {
                robot_x1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_x1"));
                }
            }
        }
        public double Robot_x2
        {
            get { return robot_x2; }
            set
            {
                robot_x2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_x2"));
                }
            }
        }
        public double Robot_x3
        {
            get { return robot_x3; }
            set
            {
                robot_x3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_x3"));
                }
            }
        }
        public double Robot_x4
        {
            get { return robot_x4; }
            set
            {
                robot_x4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_x4"));
                }
            }
        }
        public double Robot_x5
        {
            get { return robot_x5; }
            set
            {
                robot_x5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_x5"));
                }
            }
        }
        public double Robot_x6
        {
            get { return robot_x6; }
            set
            {
                robot_x6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_x6"));
                }
            }
        }

        public double Robot_y1
        {
            get { return robot_y1; }
            set
            {
                robot_y1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_y1"));
                }
            }
        }
        public double Robot_y2
        {
            get { return robot_y2; }
            set
            {
                robot_y2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_y2"));
                }
            }
        }
        public double Robot_y3
        {
            get { return robot_y3; }
            set
            {
                robot_y3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_y3"));
                }
            }
        }
        public double Robot_y4
        {
            get { return robot_y4; }
            set
            {
                robot_y4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_y4"));
                }
            }
        }
        public double Robot_y5
        {
            get { return robot_y5; }
            set
            {
                robot_y5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_y5"));
                }
            }
        }
        public double Robot_y6
        {
            get { return robot_y6; }
            set
            {
                robot_y6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_y6"));
                }
            }
        }

        public double Robot_z1
        {
            get { return robot_z1; }
            set
            {
                robot_z1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_z1"));
                }
            }
        }
        public double Robot_z2
        {
            get { return robot_z2; }
            set
            {
                robot_z2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_z2"));
                }
            }
        }
        public double Robot_z3
        {
            get { return robot_z3; }
            set
            {
                robot_z3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_z3"));
                }
            }
        }
        public double Robot_z4
        {
            get { return robot_z4; }
            set
            {
                robot_z4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_z4"));
                }
            }
        }
        public double Robot_z5
        {
            get { return robot_z5; }
            set
            {
                robot_z5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_z5"));
                }
            }
        }
        public double Robot_z6
        {
            get { return robot_z6; }
            set
            {
                robot_z6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_z6"));
                }
            }
        }

        public double Robot_g1
        {
            get { return robot_g1; }
            set
            {
                robot_g1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_g1"));
                }
            }
        }
        public double Robot_g2
        {
            get { return robot_g2; }
            set
            {
                robot_g2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_g2"));
                }
            }
        }
        public double Robot_g3
        {
            get { return robot_g3; }
            set
            {
                robot_g3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_g3"));
                }
            }
        }
        public double Robot_g4
        {
            get { return robot_g4; }
            set
            {
                robot_g4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_g4"));
                }
            }
        }
        public double Robot_g5
        {
            get { return robot_g5; }
            set
            {
                robot_g5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_g5"));
                }
            }
        }
        public double Robot_g6
        {
            get { return robot_g6; }
            set
            {
                robot_g6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_g6"));
                }
            }
        }

        public double Robot_b1
        {
            get { return robot_b1; }
            set
            {
                robot_b1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_b1"));
                }
            }
        }
        public double Robot_b2
        {
            get { return robot_b2; }
            set
            {
                robot_b2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_b2"));
                }
            }
        }
        public double Robot_b3
        {
            get { return robot_b3; }
            set
            {
                robot_b3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_b3"));
                }
            }
        }
        public double Robot_b4
        {
            get { return robot_b4; }
            set
            {
                robot_b4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_b4"));
                }
            }
        }
        public double Robot_b5
        {
            get { return robot_b5; }
            set
            {
                robot_b5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_b5"));
                }
            }
        }
        public double Robot_b6
        {
            get { return robot_b6; }
            set
            {
                robot_b6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_b6"));
                }
            }
        }

        public double Robot_a1
        {
            get { return robot_a1; }
            set
            {
                robot_a1 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_a1"));
                }
            }
        }
        public double Robot_a2
        {
            get { return robot_a2; }
            set
            {
                robot_a2 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_a2"));
                }
            }
        }
        public double Robot_a3
        {
            get { return robot_a3; }
            set
            {
                robot_a3 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_a3"));
                }
            }
        }
        public double Robot_a4
        {
            get { return robot_a4; }
            set
            {
                robot_a4 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_a4"));
                }
            }
        }
        public double Robot_a5
        {
            get { return robot_a5; }
            set
            {
                robot_a5 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_a5"));
                }
            }
        }
        public double Robot_a6
        {
            get { return robot_a6; }
            set
            {
                robot_a6 = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Robot_a6"));
                }
            }
        }


        double picture_x1;
        double picture_x2;
        double picture_x3;
        double picture_x4;
        double picture_x5;
        double picture_x6;

        double picture_y1;
        double picture_y2;
        double picture_y3;
        double picture_y4;
        double picture_y5;
        double picture_y6;

        double picture_z1;
        double picture_z2;
        double picture_z3;
        double picture_z4;
        double picture_z5;
        double picture_z6;

        double picture_g1;
        double picture_g2;
        double picture_g3;
        double picture_g4;
        double picture_g5;
        double picture_g6;

        double picture_b1;
        double picture_b2;
        double picture_b3;
        double picture_b4;
        double picture_b5;
        double picture_b6;

        double picture_a1;
        double picture_a2;
        double picture_a3;
        double picture_a4;
        double picture_a5;
        double picture_a6;

        double robot_x1;
        double robot_x2;
        double robot_x3;
        double robot_x4;
        double robot_x5;
        double robot_x6;

        double robot_y1;
        double robot_y2;
        double robot_y3;
        double robot_y4;
        double robot_y5;
        double robot_y6;

        double robot_z1;
        double robot_z2;
        double robot_z3;
        double robot_z4;
        double robot_z5;
        double robot_z6;

        double robot_g1;
        double robot_g2;
        double robot_g3;
        double robot_g4;
        double robot_g5;
        double robot_g6;

        double robot_b1;
        double robot_b2;
        double robot_b3;
        double robot_b4;
        double robot_b5;
        double robot_b6;

        double robot_a1;
        double robot_a2;
        double robot_a3;
        double robot_a4;
        double robot_a5;
        double robot_a6;

    }

}
